#include "BleMedia.h"
#include <Arduino.h>

void BleMedia::begin(NimBLEHIDDevice* hid) {
  inputMedia = hid->getInputReport(3);  // Report ID 3：多媒体
}

void BleMedia::send(uint8_t bitmask) {
  uint8_t report[] = {bitmask};
  inputMedia->setValue(report, sizeof(report));
  inputMedia->notify();
  delay(100);

  report[0] = 0;
  inputMedia->setValue(report, sizeof(report));
  inputMedia->notify();
}
